public class Test {
    public static int function(int n){

        if(n==1){

            //递归终止条件
            return 1;
        }
        else{

            //递归调用
            return function(n - 1) * n;
        }
    }

    public static void main(String[] args) {
        int num = 3;
        int ret =function(num);
        System.out.println(ret);

    }
}
